
package com.zsrt.oa.bank.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.google.gson.Gson;
import com.zsrt.oa.bank.service.BankService;
@RequestMapping("/bank")
@Controller
public class BankController {

	@Autowired
	private BankService service;
	
	/**
	 * http://localhost:8088/jmj-maven-ssm-ch01/bank/findBankById?id=1
	 * @param id
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/findBankById")
	public Map<String, Object> findBankById(int id){
		Map<String, Object> map = new HashMap<>();
		service.findBankById(id, map );
		System.err.println(new Gson().toJson(map));
		return map;
	}
	
}
